import httpInstance from '@/utils/https.js'

// 添加作品
export const workAddApi = (data) => {
    return httpInstance({
        url: '/work/add',
        method: 'POST',
        data
    })
}

// 展示作品
export const workListApi = () => {
    return httpInstance({
        url: '/work/list',
        method: 'GET'
    })
}

// 展示作品
export const workMyListApi = () => {
    return httpInstance({
        url: '/work/myList',
        method: 'GET'
    })
}

// 根据ID获取作品详情
export const workDetailApi = (params) => {
    return httpInstance({
        url: '/work/getOne',
        method: 'GET',
        params
    })
}

// 根据ID获取作品详情
export const updateWorkApi = (params) => {
    return httpInstance({
        url: '/work/update',
        method: 'PUT',
        params
    })
}

//点赞作品
export const likeWorkApi = (params) => {
    return httpInstance({
        url: '/work/like',
        method: 'GET',
        params
    })
}

//取消点赞作品
export const dislikeWorkApi = (params) => {
    return httpInstance({
        url: '/work/dislike',
        method: 'GET',
        params
    })
}

export const isLikeWorkApi = (params) => {
    return httpInstance({
        url: '/work/isLike',
        method: 'GET',
        params
    })
}

export const workLikeNumApi = (params) => {
    return httpInstance({
        url: '/work/likeNum',
        method: 'GET',
        params
    })
}

//点赞作品
export const favorWorkApi = (params) => {
    return httpInstance({
        url: '/work/favor',
        method: 'GET',
        params
    })
}

//取消点赞作品
export const disfavorWorkApi = (params) => {
    return httpInstance({
        url: '/work/disfavor',
        method: 'GET',
        params
    })
}

export const isFavorWorkApi = (params) => {
    return httpInstance({
        url: '/work/isFavor',
        method: 'GET',
        params
    })
}

export const workFavorNumApi = (params) => {
    return httpInstance({
        url: '/work/favorNum',
        method: 'GET',
        params
    })
}

export const workFavorListApi = () => {
    return httpInstance({
        url: '/work/favorWorkList',
        method: 'GET'
    })
}

export const workLikeListApi = () => {
    return httpInstance({
        url: '/work/likeWorkList',
        method: 'GET'
    })
}

export const workCommentsListApi = () => {
    return httpInstance({
        url: '/work/commentsWorkList',
        method: 'GET'
    })
}